﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;

namespace PauloC.DAL
{
    public class Initialize : DropCreateDatabaseIfModelChanges<Context>
    {
        public Initialize(Context dbContext)
        {
            if (!dbContext.Database.Exists())
            {
                //if (!dbContext.Database.CompatibleWithModel(true))
                //{
                dbContext.Database.Create();
                //}
            }
            else
            {
                if (!dbContext.Database.CompatibleWithModel(true))
                {
                    dbContext.Database.Create();
                }
            }
        }
    }
}
